/*  BlogBotShop.java Version 101 - 3rd April 2008
 *  BlogBotShop.java is a place to strore program wide global varibles, it is static.
 *  See Versions for program version number
 *  Copyright (C) 2008  Andy Broomfield andy@newmediathinking.com
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
*/

package net.blogbotplatform.blogbot;



import java.util.ArrayList;

//import java.util.*;

public class BlogBotShop {
	//values for data store
	static int[] dataBuffer = new int[10000];
	static int dataBufferIndex;
	static int lastByte;
	
	//values for serial and paralel ports
	static String serialPortChosen;
	static String parallelPortChosen;
	
	//temp place for writing to Blog Text Area
	static String screenBlogText;
	
	//values for sleep / wake
	static boolean timedSleep;
	static int wakeHour;
	static int sleepHour;
	
	//twitter account storage
	static boolean useTwitter;
	static String twitterUsername;
	static String twitterPassword;
	
	/*static final int MODE_VERYDARK = 0;
	static final int MODE_DARK = 1;
	static final int MODE_DIM = 2;
	static final int MODE_OK = 3;
	static final int MODE_BRIGHT = 4;
	static final int MODE_BURN = 5; */
	static int NUM_OF_MODES = 6;
	
	//arrays for comment values
	static ArrayList PAST_COMMENTS[] = new ArrayList[NUM_OF_MODES];
	static ArrayList LIVE_COMMENTS[] = new ArrayList[NUM_OF_MODES];
	
	public BlogBotShop() {
		//set base values
		//use as trick flag for when blog bot first starts
		//dataBuffer[0] = -1;
		
		//intilizes the comment array lists
		for (int i = 0; i < NUM_OF_MODES; i++) {
		PAST_COMMENTS[i] = new ArrayList();
		LIVE_COMMENTS[i] = new ArrayList();
		}
	}
	
	static void serialValue(int value) {
		//add to the buffer
		//dataBuffer[dataCounter] = serialMessage;
		lastByte = value;
		dataBuffer[dataBufferIndex] = value;
		//println(dataCounter + " value: " + serialMessage);
		dataBufferIndex++;  
		
		if(dataBufferIndex >= dataBuffer.length) dataBufferIndex = 0;

		if(value == 255) {
			dataBufferIndex = 0;
			//println("recorded new item at elapsed time " + (system.currentTime.millis()-bufferStartTime));
		}
	}
}
